package demo;

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();
        //创建大根堆,来每次数最大除以二
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b)->{
            return b-a;
        });
        long sum = 0,x;
        for(int i= 0; i<n;i++){
            //输入n个a[i]
            x=in.nextLong();
            //求和
            sum +=x;
            //找偶数,添加到大根堆中
            if(x%2 == 0){
                heap.add((int)x);

            }
        }
        //最大偶数除2,总和减去最大偶数一半
        while(!heap.isEmpty() && k-- != 0){
            long s = heap.poll()/2;
            sum -= s;
            if(s % 2 == 0){
                heap.add((int)s);
            }

        }
        System.out.println(sum);


    }
}

